#ifndef EPUBDUKPT_COMM_LOG_HPP
#define EPUBDUKPT_COMM_LOG_HPP

SJR_NAMESPACE_BEGIN

class EpubLog final {
public:
  constexpr static char FormatInfo[] = "[INFO] %s\n";
  constexpr static char FormatDbug[] = "[DBUG] %s\n";
  constexpr static char FormatErro[] = "[ERRO] %s\n";

  EpubLog() = delete;

  template<class... Args>
  static void info(std::string const &format, Args... args) {
    auto &&fmt = EpubFormat::format(format, args...);
    printf(FormatInfo, fmt.c_str());
  }

  template<class... Args>
  static void dbug(std::string const &format, Args... args) {
    auto &&fmt = EpubFormat::format(format, args...);
    printf(FormatDbug, fmt.c_str());
  }

  template<class... Args>
  static void erro(std::string const &format, Args... args) {
    auto &&fmt = EpubFormat::format(format, args...);
    printf(FormatErro, fmt.c_str());
  }

  template<class T, class K>
  static void array(T const *in, K inLen) {
    auto &&fmt = EpubFormat::string(reinterpret_cast<unsigned char *>(const_cast<T *>(in)),
      static_cast<int>(inLen));
    printf(FormatInfo, fmt.c_str());
  }
};

SJR_NAMESPACE_END

#endif//EPUBDUKPT_COMM_LOG_HPP
